package br.com.materiais.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import br.com.materiais.dao.MateriaisDao;
import br.com.materiais.model.MaterialModel;

public class ListaProdutosAction extends Action 
{
	
	@SuppressWarnings("unchecked")
	@Override
	public ActionForward execute(ActionMapping map, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception 
    {
		List<MaterialModel> listMaterial = new MateriaisDao().getListaMateriais();
		request.setAttribute("materiais", listMaterial);
		
		return map.findForward("ok");
		
	}

}
